<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>作业管理系统</title>

    <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="../../css/base.css">
    <script type="text/javascript" src="../../layui/layui.js"></script>
    <script type="text/javascript" src="../../framework/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../../framework/frameAll.js"></script>

    <style>
        .shortInput {
            width: 50% !important;
        }
    </style>
    <script type="text/javascript">
        function getInfo() {
            var data = {
                id: $("input[name=id]").val(),
                no: $("input[name=no]").val(),
                name: $("input[name=name]").val(),
                age: $("input[name=age]").val(),
                sex: $(":checked").val(),
                sexName: $(":checked").attr("title"),
                password: $("input[name=password]").val(),
            };
            return data;
        }

        function load(data) {
            layui.use('form', function () {
                var form = layui.form;
                form.val('infoForm', {
                    id: data.id,
                    no: data.no,
                    name: data.name,
                    age: data.age,
                    sex: data.sex==="男"?0:1,
                    password: data.password
                });
            });
        }
    </script>
</head>

<body>
<div class="cBody">
    <form id="addForm" class="layui-form" action="" lay-filter="infoForm">
        <br>
        <div class="layui-form-item" style="display: none">
            <label class="layui-form-label">编号</label>
            <div class="layui-input-inline shortInput">
                <input type="text" name="id" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">教师号 : </label>
            <div class="layui-input-inline shortInput">
                <input type="text" name="no" autocomplete="off" class="layui-input"
                       placeholder="教师号为6到12位">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓&emsp;名 : </label>
            <div class="layui-input-inline shortInput">
                <input type="text" name="name" autocomplete="off" class="layui-input"
                       placeholder="姓名为2-5个汉字">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">年&emsp;龄 : </label>
            <div class="layui-input-inline shortInput">
                <input type="text" name="age" autocomplete="off" class="layui-input"
                       placeholder="年龄在1-120岁之间">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密&emsp;码 : </label>
            <div class="layui-input-inline shortInput">
                <input type="password" name="password" autocomplete="off"
                       class="layui-input" placeholder="不输入默认为教师号">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性&emsp;别 : </label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="0" title="男" checked>
                <input type="radio" name="sex" value="1" title="女">
            </div>
        </div>
    </form>
</div>
</body>
</html>